package org.wanho.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Author：汤小洋
 * Date：2023-04-20 15:10
 * Description：<描述>
 */
//@WebServlet("/world")
//@WebServlet("/aa/*")
@WebServlet("*.do") // 不能以正斜杠开头
public class WorldServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("接收到了请求！！！！");

        resp.setContentType("text/html;charset=utf8");

        PrintWriter out = resp.getWriter();
        out.print("<h3 style='color:green;'>请求已收到</h3>");
        out.print("<hr>");
        out.print("<p>嘿嘿</p>");
        out.close();

    }
}
